module ui {
	export class MainGame extends core.BaseEuiView {
		private BaseGroup: eui.Group
		private ScoreL: eui.Label

		public constructor(controller: core.BaseController, parent: egret.DisplayObjectContainer) {
			super(controller, parent)
			this.addEventListener(eui.UIEvent.COMPLETE, this.onComplete, this)
			core.App.ViewManager.register(ui.ViewConst.MainGame, this)
		}

		protected partAdded(partName: string, instance: any): void {
			super.partAdded(partName, instance);
		}


		protected childrenCreated(): void {
			super.childrenCreated();
		}

		private onComplete(evt: eui.UIEvent) {
			this.BaseGroup.x = 0
			this.BaseGroup.y = 0
			this.BaseGroup.anchorOffsetX = 0
			this.BaseGroup.anchorOffsetY = 0
			this.BaseGroup.width = egret.MainContext.instance.stage.stageWidth
			this.BaseGroup.height = egret.MainContext.instance.stage.stageHeight

			this.ScoreL.text = "Score:0"
			this.ScoreL.strokeColor = 0xE0A006
			this.ScoreL.stroke = 2
		}

		public SetScoreLText(text: string) {
			this.ScoreL.text = "Score:" + text
		}
	}
}